Class MyEventAttendeesComparator


  • public class MyEventAttendeesComparator
    extends MyEventComparator
    This class represents the concept of comparison of two events by number of attendees.
    Since:
    ExerciseSheet04
    Version:
    1
    Author:
    Jonas Altrock (ew20b126@technikum-wien.at)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Event e1, Event e2)
      Compares two events by the number of attendees.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MyEventAttendeesComparator

        public MyEventAttendeesComparator()
    • Method Detail

      • compare

        public int compare​(Event e1,
                           Event e2)
        Compares two events by the number of attendees.

        This comparator handles null arguments such that two null events are equal, and any null event is smaller than any non-null event.

        Specified by:
        compare in class MyEventComparator
        Parameters:
        e1 - the one event to compare
        e2 - the other event to compare
        Returns:
        a measure of the distance between e1 and e2 in the sense of the comparator